import 'package:flutter/material.dart';
import 'package:shop/common/baseContext.dart';
import 'package:shop/commonWidget/MyWeb.dart';
import 'package:shop/utils/router_utils.dart';
import 'package:shop/view/GuidePage.dart';
import 'package:shop/view/login/CodeLogin.dart';
import 'package:shop/view/login/LoginList.dart';
import 'package:shop/view/login/PwLogin.dart';
import 'package:shop/view/login/QuickLogin.dart';
import 'package:shop/view/login/SendCode.dart';
import 'package:shop/view/setting/Setting.dart';
import 'package:shop/view/tabs/Tabs.dart';
import 'package:shop/view/zhibo/IjKPlayPage.dart';
import 'package:shop/view/zhibo/RtmpPage.dart';

// 路由类

NavigatorState route = Navigator.of(BaseContext.baseContext);

class MyRoutes {
  static const String tabs = "/tabs";
  static const String guidePage = "/guidePage";
  static const String rtmp = "/rtmp";
  static const String play = "/play";
  static const String codeLogin = "/codeLogin";
  static const String sendCode = "/sendCode";
  static const String pwLogin = "/pwLogin";
  static const String setting = "/setting";
  static const String quickLogin = "/quickLogin";
  static const String loginList = "/loginList";
  static const String myWeb = "/myWeb";

  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case guidePage:
        return NoAnimRouter(child: GuidePage());
      case tabs:
        return Right2LeftRouter(child: Tabs());
      case sendCode:
        return Right2LeftRouter(child: SendCode(phone: settings.arguments));
      case codeLogin:
        return FadeRouter(child: CodeLogin(phone: settings.arguments));
      case rtmp:
        return Right2LeftRouter(child: RtmpPage());
      case setting:
        return Right2LeftRouter(child: Setting());
      case myWeb:
        return Right2LeftRouter(child: MyWeb(url: settings.arguments));
      case quickLogin:
        return Right2LeftRouter(child: QuickLogin());
      case loginList:
        return Bottom2TopRouter(child: LoginList());
      case play:
        return Right2LeftRouter(child: IjKPlayPage());
      case pwLogin:
        return Right2LeftRouter(child: PwLogin(phone: settings.arguments));

      default:
        return MaterialPageRoute(
            builder: (_) => Scaffold(
                  body: Center(
                    child: Text('没有这个路由: ${settings.name}'),
                  ),
                ));
    }
  }
}
